﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Controls="clr-namespace:Sinacor.Infra.UI.Controls.SmartClient;assembly=Sinacor.Infra.UI.Controls">

    <!--BEGIN IDENTIFICADOR INVESTIDOR-->
    <Style TargetType="{x:Type Controls:SinacorIdentificadorInvestidor}">
        <Setter Property="Height" Value="21"/>
        <Setter Property="Width" Value="250"/>
        <Setter Property="KeyboardNavigation.TabNavigation" Value="Local"/>
        <Setter Property="KeyboardNavigation.IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorIdentificadorInvestidor}">
                    <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="4"/>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Controls:SinacorComboBox Grid.Column="0" x:Name="cbControlSelector" Width="96" HorizontalAlignment="Left" IsRequired="{TemplateBinding IsRequired}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}"/>

                        <Grid Grid.Column="2">
                            <Controls:SinacorCnpjTextBox x:Name="txtCNPJ" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCnpjErrorMessage="{TemplateBinding InvalidCnpjErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCpfReadOnly}" />
                            <Controls:SinacorCpfTextBox x:Name="txtCPF" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCpfErrorMessage="{TemplateBinding InvalidCpfErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCnpjReadOnly}" />
                            <Controls:SinacorCvmTextBox x:Name="txtCVM" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCvmErrorMessage="{TemplateBinding InvalidCvmErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCvmReadOnly}" />
                            <Controls:SinacorInvestidorEstrangeiroTextBox x:Name="txtClienteEstrangeiro" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidInvestidorEstrangeiroErrorMessage="{TemplateBinding InvalidClienteEstrangeiroErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsClienteEstrangeiroReadOnly}" />
                            <Controls:SinacorFilteredTextBox x:Name="txtOutros" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" FilterExpression="^\d{0,15}$" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsOutrosReadOnly}" />
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <!--END IDENTIFICADOR INVESTIDOR-->

    <Style x:Key="ControlDataGridSinacorIdentificadorInvestidor" TargetType="{x:Type Controls:SinacorIdentificadorInvestidor}" BasedOn="{StaticResource {x:Type Controls:SinacorIdentificadorInvestidor}}">
        <Setter Property="Width" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:SinacorIdentificadorInvestidor}">
                    <Grid Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="10"/>
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Controls:SinacorComboBox Grid.Column="0" x:Name="cbControlSelector" Width="90" HorizontalAlignment="Left" IsRequired="{TemplateBinding IsRequired}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}"/>

                        <Grid Grid.Column="2">
                            <Controls:SinacorCnpjTextBox x:Name="txtCNPJ" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCnpjErrorMessage="{TemplateBinding InvalidCnpjErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCpfReadOnly}" />
                            <Controls:SinacorCpfTextBox x:Name="txtCPF" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCpfErrorMessage="{TemplateBinding InvalidCpfErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCnpjReadOnly}" />
                            <Controls:SinacorCvmTextBox x:Name="txtCVM" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidCvmErrorMessage="{TemplateBinding InvalidCvmErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsCvmReadOnly}" />
                            <Controls:SinacorInvestidorEstrangeiroTextBox x:Name="txtClienteEstrangeiro" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" InvalidInvestidorEstrangeiroErrorMessage="{TemplateBinding InvalidClienteEstrangeiroErrorMessage}" RequiredErrorMessage="{TemplateBinding RequiredErrorMessage}" IsReadOnly="{TemplateBinding IsClienteEstrangeiroReadOnly}" />
                            <Controls:SinacorFilteredTextBox x:Name="txtOutros" HorizontalAlignment="Stretch" Width="Auto" IsRequired="{TemplateBinding IsRequired}" FilterExpression="^\d{0,15}$" IsReadOnly="{TemplateBinding IsOutrosReadOnly}" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ComboSelection" Value="{x:Null}">
                            <Setter Property="Background" Value="Transparent" TargetName="txtOutros" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>